home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
dispms
/
dispmsg.frm
< prev
next >
Wrap
Text File
|
1995-05-08
|
6KB
|
203 lines
VERSION 2.00
Begin Form DispMsg
Caption = "Display Message"
ClientHeight = 4170
ClientLeft = 2655
ClientTop = 1740
ClientWidth = 3810
Height = 4575
Icon = DISPMSG.FRX:0000
Left = 2595
LinkTopic = "Form1"
ScaleHeight = 4170
ScaleWidth = 3810
Tag = "Display Message (c) 1994 Rufan Redi Productions"
Top = 1395
Width = 3930
Begin CommandButton Command3
Caption = "&What's the time ?"
Height = 315
Left = 120
TabIndex = 11
Top = 1020
Width = 1695
End
Begin HScrollBar HScroll1
Height = 255
Left = 2040
Max = 999
TabIndex = 9
Tag = "This is a slider bar"
Top = 1320
Width = 1515
End
Begin CommandButton Command2
Caption = "&See the Author !"
Height = 375
Left = 120
TabIndex = 8
Tag = "For an introduction to the author ..."
Top = 1380
Width = 1695
End
Begin PictureBox Picture1
Height = 1815
Left = 60
Picture = DISPMSG.FRX:0302
ScaleHeight = 1785
ScaleWidth = 2865
TabIndex = 7
Tag = "This is a little bit of a space man !"
Top = 1860
Width = 2895
End
Begin ComboBox Combo1
Height = 300
Left = 1860
TabIndex = 6
Tag = "Drop this down to see a list of things"
Text = "Drop me down !"
Top = 840
Width = 1875
End
Begin CommandButton Command1
Caption = "&Hello"
Default = -1 'True
Height = 495
Left = 120
TabIndex = 5
Tag = "Push here to say Hello"
Top = 480
Width = 1695
End
Begin OptionButton Option1
Caption = "Option Two"
Height = 315
Index = 1
Left = 1980
TabIndex = 4
Tag = "Clich here to set the second option"
Top = 420
Width = 1335
End
Begin OptionButton Option1
Caption = "Option One"
Height = 315
Index = 0
Left = 1980
TabIndex = 3
Tag = "Click on this line to chose the first option"
Top = 60
Value = -1 'True
Width = 1335
End
Begin CheckBox Check1
Caption = "A Check Box"
Height = 375
Left = 240
TabIndex = 2
Tag = "Click here to set the check-box"
Top = 60
Width = 1635
End
Begin CommandButton Exit
Cancel = -1 'True
Caption = "E&xit"
Height = 495
Left = 3060
TabIndex = 1
Tag = "This button exits the demo form"
Top = 3240
Width = 675
End
Begin Timer MessageTimer
Enabled = 0 'False
Interval = 250
Left = 3180
Top = 1920
End
Begin Label Label1
Caption = "Slider value"
Height = 195
Left = 2400
TabIndex = 10
Tag = "Shows the slider bar value"
Top = 1620
Width = 1035
End
Begin Label Message
BorderStyle = 1 'Fixed Single
Height = 255
Left = 0
TabIndex = 0
Top = 3900
Width = 7335
End
End
Sub Check1_Click ()
' Example of a quick information message
If Check1.Value Then
Message.Caption = "I've just been set"
Else
Message.Caption = "I've just been cleared"
End If
End Sub
Sub Command1_Click ()
MsgBox "Hello !" + Chr$(13) + "Welcome to the DisplayMessage Demo." + Chr$(13) + "Please review the ReadMe procedure in DispMsg.Bas", , "Display Message"
End Sub
Sub Command2_Click ()
' As you can see - it is possible to manually change the message as well
Message.Caption = "Double click to close this picture..."
Jeremy.Show
End Sub
Sub Command3_Click ()
Command3.Tag = "This button was last clicked at " + Time$
End Sub
Sub Exit_Click ()
End
End Sub
Sub Form_Activate ()
MessageTimer.Enabled = True
End Sub
Sub Form_Deactivate ()
MessageTimer.Enabled = False
End Sub
Sub Form_Load ()
Combo1.AddItem "Item One"
Combo1.AddItem "Another Item"
Combo1.AddItem "This is Item Three"
Combo1.AddItem "Four Items is enough !"
End Sub
Sub Form_Resize ()
' Find the size of the Windows Client area
Call GetClientRect(DispMsg.hWnd, lpRect)
' Set the width of the message to equal the window
Message.Width = lpRect.Width * Screen.TwipsPerPixelX
' And make sure that the box is always the same distance from the bottom
Message.Top = (lpRect.Height * Screen.TwipsPerPixelY) - Message.Height
End Sub
Sub HScroll1_Change ()
Label1.Caption = "Slider:" + Str$(HScroll1.Value)
' This demonstrates dynamically changing the slider value
Label1.Tag = "Slider value set to" + Str$(HScroll1.Value)
End Sub
Sub MessageTimer_Timer ()
Call DisplayMessage(DispMsg)
End Sub
Sub Option1_Click (Index As Integer)
' A quick information message
Message.Caption = "Option" + Str$(Index + 1) + " has been set"
End Sub